#!/usr/bin/env python

#build liboctopus-core
bld.shlib(
	features       = 'c cshlib',
	target         = 'octopus-core',
	source         = ['octopus-active-playlist.vala',
	                  'octopus-active-playlist-entry.vala',
	                  'octopus-album.vala',
	                  'octopus-albumartloader.vala',
	                  'octopus-albumlist.vala',
	                  'octopus-collection.vala',
	                  'octopus-collectionlist.vala',
	                  'octopus-configure.vala',
	                  'octopus-global.vala',
	                  'octopus-interfaces.vala',
	                  'octopus-medialibtracklist.vala',
	                  'octopus-medialibsearch.vala',
	                  'octopus-track.vala',
	                  'octopus-playback.vala',
	                  'octopus-playlist.vala',
	                  'octopus-utils.vala',
	                  'octopus-xmms-client.vala'],
	vapi_dirs      = '../vapi',
	gir            = 'Octopus-1.0',
	packages       = ['config',
	                  'clutter-1.0',
	                  'clutter-gtk-1.0',
	                  'gdk-pixbuf-2.0',
	                  'gee-1.0',
	                  'mx-2.0',
	                  'xmms2-client',
	                  'xmms2-client-glib'],
	uselib         = ['CLUTTER',
	                  'CLUTTER_GTK',
	                  'GDK_PIXBUF',
	                  'GEE',
	                  'MX',
	                  'XMMS',
	                  'XMMS_GLIB']
	)

bld(
	rule         = 'g-ir-compiler ${SRC} -o ${TGT} --shared-library liboctopus-core.so',
	target       = 'Octopus-1.0.typelib',
	source       = ['Octopus-1.0.gir'],
	install_path = '${LIBDIR}/octopus'
	)

#build liboctopus-mx
bld.shlib(
	features       = 'c cshlib',
	target         = 'octopus-mx',
	source         = [
	                  'mx/octopus-mx-c.c',
	                  'mx/octopus-mx-extern.vala',
	                  'mx/octopus-mx-frame-track.vala',
	                  'mx/octopus-mx-grid.vala',
	                  'mx/octopus-mx-reflection-effect.vala',
	                  'mx/octopus-mx-tracklist.vala',
	                  'mx/octopus-mx-utils.vala',
	                  'mx/octopus-mx-z-deform.vala'
	                  ],
	vapi_dirs      = '../vapi',
	gir            = 'OctopusMx-1.0',
	use            = 'octopus-core'
	)

bld(
	rule         = 'g-ir-compiler ${SRC} -o ${TGT} --shared-library liboctopus-mx.so',
	target       = 'OctopusMx-1.0.typelib',
	source       = ['OctopusMx-1.0.gir'],
	install_path = '${LIBDIR}/octopus'
	)

#build liboctopus-clutter-gtk
bld.shlib(
	features       = 'c cshlib',
	target         = 'octopus-clutter-gtk',
	source         = ['clutter-gtk/octopus-clutter-gtk.vala'],
	vapi_dirs      = '../vapi',
	gir            = 'OctopusClutterGtk-1.0',
	use            = 'octopus-core'
	)

bld(
	rule         = 'g-ir-compiler ${SRC} -o ${TGT} --shared-library liboctopus-clutter-gtk.so',
	target       = 'OctopusClutterGtk-1.0.typelib',
	source       = ['OctopusClutterGtk-1.0.gir'],
	install_path = '${LIBDIR}/octopus'
	)

#build octopus
bld.program(
	features     = 'c cprogram',
	target       = 'octopus',
	source       = [
	                'main.vala',
	                'octopus-c.c',
	                'octopus-extern.vala',
	                'ui/octopus-ui-main.vala',
	                'ui/octopus-ui-playlist-panel.vala',
	                'ui/octopus-ui-album-art.vala',
	                'ui/octopus-ui-medialib-panel.vala',
	                'ui/octopus-ui-browse-panel.vala',
	                'ui/octopus-ui-tracklist-panel.vala',
	                'ui/octopus-ui-loadscreen.vala',
	                'ui/octopus-ui-bottom-panel.vala',
	                'ui/octopus-ui-properties-dialog.vala'
	               ],
	vapi_dirs    = '../vapi',
	uselib       = ['GI', 'GJS'],
	use          = ['octopus-core', 'octopus-mx']
	)
